package dlally.model;

/**
 * Data structure for maintaining information about a connection between two lines
 * @author Douglas Lally (dlally@wpi.edu)
 *
 */
public class Edge {
	/**
	 * Each edge will have the index of the lines to the left and right, as well as the height from the top.
	 */
	int left;
	int right;
	int height;
	/**
	 * Simple constructor
	 * @param left the index of the line to the left
	 * @param right the index of the line to the right
	 * @param height the height of this line
	 */
	public Edge(int left, int right, int height) {
		super();
		this.left = left;
		this.right = right;
		this.height = height;
	}
	/**
	 * Override for the default equals method
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Edge other = (Edge) obj;
		if (height != other.height)
			return false;
		if (left != other.left)
			return false;
		if (right != other.right)
			return false;
		return true;
	}
	/**
	 * @return the left
	 */
	public int getLeft() {
		return left;
	}
	
	/**
	 * @return the right
	 */
	public int getRight() {
		return right;
	}
	
	/**
	 * @return the height
	 */
	public int getHeight() {
		return height;
	}
}
